<%--
  收发货在制品状况
  User: Ivan
  Date: 2019-09-03 12:41
--%>
<style type="text/css">
tr, th, td {
    text-align: center;
}
</style>

<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${SYS_QUERY_PATH}" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel"/>
            <label>开始日期<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="startTime" class="form-control" data-rule="required"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd"
                   size="11" id="start-date-input" readonly value="${startTime}"/>&nbsp;
            <label>结束日期<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="endTime" class="form-control" data-rule="required"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd"
                   size="11" id="end-date-input" readonly value="${endTime}"/>&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue"
                    onclick="javascript:bjuiExportExl('#pagerForm', '${request.getContextPath()}/Manufacture/exportExcel')"
                    data-icon="file-excel-o" title="导出Excel">导出</button>
        </div>
    </form>
</div>

<div class="bjui-pageContent tableContent">
    <g:if test="${customerRecGoodsList.size() > 0}">
        <!-- 客户来货 -->
        <div style="margin:0px auto; width:96%;">
            <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" data-toggle="tablefixed" data-width="100%">
                <thead>
                <tr>
                    <th width="50">NO.</th>
                    <th width="200">客户来货</th>
                    <g:each in="${dateList}" status="i" var="headInstance">
                        <th width="100">${headInstance.TRANS_TIME}</th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${customerRecGoodsList}" status="i" var="dataInstance">
                    <tr data-id="data1">
                        <td>${i + 1}</td>
                        <td>${dataInstance.CUSTOMER}</td>
                        <g:each in="${dateList}" status="j" var="headInstance">
                            <td>
                                <g:if test="${dataInstance.CUSTOMER == '合计'}">
                                    ${dataInstance[headInstance.TRANS_TIME]}
                                </g:if>
                                <g:else>
                                    <a href="${request.getContextPath()}/Manufacture/manufactureDetail?flag=customerRecGoods&clazz=<%=dataInstance.CUSTOMER%>&startTime=<%=headInstance.TRANS_TIME%>"
                                       data-toggle="navtab" data-id="dialog-normal"
                                       data-options="{id:'manufactureDetail', title:'客户${dataInstance.CUSTOMER}(${headInstance.TRANS_TIME})来货明细'}">
                                        ${dataInstance[headInstance.TRANS_TIME]}
                                    </a>
                                </g:else>
                            </td>
                        </g:each>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </g:if>
    <g:if test="${customerWipList.size() > 0}">
        <!-- 客户在制品 -->
        <div style="margin:20px auto; width:96%;">
            <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" data-toggle="tablefixed" data-width="100%">
                <thead>
                <tr>
                    <th width="50">NO.</th>
                    <th width="200">客户在制品</th>
                    <g:each in="${dateList}" status="i" var="headInstance">
                        <th width="100">${headInstance.TRANS_TIME}</th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${customerWipList}" status="i" var="dataInstance">
                    <tr data-id="data2">
                        <td>${i + 1}</td>
                        <td>${dataInstance.CUSTOMER}</td>
                        <g:each in="${dateList}" status="j" var="headInstance">
                            <td>
                                <g:if test="${dataInstance.CUSTOMER == '合计'}">
                                    ${dataInstance[headInstance.TRANS_TIME]}
                                </g:if>
                                <g:else>
                                    <a href="${request.getContextPath()}/Manufacture/manufactureDetail?flag=customerWip&clazz=<%=dataInstance.CUSTOMER%>&startTime=<%=headInstance.TRANS_TIME%>"
                                       data-toggle="navtab" data-id="dialog-normal"
                                       data-options="{id:'manufactureDetail', title:'客户${dataInstance.CUSTOMER}(${headInstance.TRANS_TIME})在制品明细'}">
                                        ${dataInstance[headInstance.TRANS_TIME]}
                                    </a>
                                </g:else>
                            </td>
                        </g:each>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </g:if>
    <g:if test="${customerDelGoodsList.size() > 0}">
        <!-- 客户发货 -->
        <div style="margin:20px auto; width:96%;">
            <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" data-toggle="tablefixed" data-width="100%">
                <thead>
                <tr>
                    <th width="50">NO.</th>
                    <th width="200">客户发货</th>
                    <g:each in="${dateList}" status="i" var="headInstance">
                        <th width="100">${headInstance.TRANS_TIME}</th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${customerDelGoodsList}" status="i" var="dataInstance">
                    <tr data-id="data3">
                        <td>${i + 1}</td>
                        <td>${dataInstance.CUSTOMER}</td>
                        <g:each in="${dateList}" status="j" var="headInstance">
                            <td>
                                <g:if test="${dataInstance.CUSTOMER == '合计'}">
                                    ${dataInstance[headInstance.TRANS_TIME]}
                                </g:if>
                                <g:else>
                                    <a href="${request.getContextPath()}/Manufacture/manufactureDetail?flag=customerDelGoods&clazz=<%=dataInstance.CUSTOMER%>&startTime=<%=headInstance.TRANS_TIME%>"
                                       data-toggle="navtab" data-id="dialog-normal"
                                       data-options="{id:'manufactureDetail', title:'客户${dataInstance.CUSTOMER}(${headInstance.TRANS_TIME})发货明细'}">
                                        ${dataInstance[headInstance.TRANS_TIME]}
                                    </a>
                                </g:else>
                            </td>
                        </g:each>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </g:if>
    <g:if test="${projectRecGoodsList.size() > 0}">
        <!-- 项目（课别+部门）来货 -->
        <div style="margin:20px auto; width:96%;">
            <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" data-toggle="tablefixed" data-width="100%">
                <thead>
                <tr>
                    <th width="50">NO.</th>
                    <th width="200">课别+部门 来货</th>
                    <g:each in="${dateList}" status="i" var="headInstance">
                        <th width="100">${headInstance.TRANS_TIME}</th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${projectRecGoodsList}" status="i" var="dataInstance">
                    <tr data-id="data4">
                        <td>${i + 1}</td>
                        <td>${dataInstance.KEBIE_DEPT}</td>
                        <g:each in="${dateList}" status="j" var="headInstance">
                            <td>
                                <g:if test="${dataInstance.KEBIE_DEPT == '合计'}">
                                    ${dataInstance[headInstance.TRANS_TIME]}
                                </g:if>
                                <g:else>
                                    <a href="${request.getContextPath()}/Manufacture/manufactureDetail?flag=projectRecGoods&clazz=<%=dataInstance.KEBIE_DEPT%>&startTime=<%=headInstance.TRANS_TIME%>"
                                       data-toggle="navtab" data-id="dialog-normal"
                                       data-options="{id:'manufactureDetail', title:'课别+部门${dataInstance.KEBIE_DEPT}(${headInstance.TRANS_TIME})来货明细'}">
                                        ${dataInstance[headInstance.TRANS_TIME]}
                                    </a>
                                </g:else>
                            </td>
                        </g:each>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </g:if>
    <g:if test="${projectWipList.size() > 0}">
        <!-- 项目（课别+部门）在制品 -->
        <div style="margin:20px auto; width:96%;">
            <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" data-toggle="tablefixed" data-width="100%">
                <thead>
                <tr>
                    <th width="50">NO.</th>
                    <th width="200">课别+部门 在制品</th>
                    <g:each in="${dateList}" status="i" var="headInstance">
                        <th width="100">${headInstance.TRANS_TIME}</th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${projectWipList}" status="i" var="dataInstance">
                    <tr data-id="data5">
                        <td>${i + 1}</td>
                        <td>${dataInstance.KEBIE_DEPT}</td>
                        <g:each in="${dateList}" status="j" var="headInstance">
                            <td>
                                <g:if test="${dataInstance.KEBIE_DEPT == '合计'}">
                                    ${dataInstance[headInstance.TRANS_TIME]}
                                </g:if>
                                <g:else>
                                    <a href="${request.getContextPath()}/Manufacture/manufactureDetail?flag=projectWip&clazz=<%=dataInstance.KEBIE_DEPT%>&startTime=<%=headInstance.TRANS_TIME%>"
                                       data-toggle="navtab" data-id="dialog-normal"
                                       data-options="{id:'manufactureDetail', title:'课别+部门${dataInstance.KEBIE_DEPT}(${headInstance.TRANS_TIME})在制品明细'}">
                                        ${dataInstance[headInstance.TRANS_TIME]}
                                    </a>
                                </g:else>
                            </td>
                        </g:each>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </g:if>
    <g:if test="${totalList.size() > 0}">
        <!-- 总体状况 -->
        <div style="margin:20px auto; width:96%;">
            <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" data-toggle="tablefixed" data-width="100%">
                <thead>
                <tr>
                    <th width="50">NO.</th>
                    <th width="200">总体状况</th>
                    <g:each in="${dateList}" status="i" var="headInstance">
                        <th width="100">${headInstance.TRANS_TIME}</th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${totalList}" status="i" var="dataInstance">
                    <tr data-id="data6">
                        <td>${i + 1}</td>
                        <td>${dataInstance.CLAZZ}</td>
                        <g:each in="${dateList}" status="j" var="headInstance">
                            <td>
                                <g:if test="${dataInstance.CLAZZ == '合计'}">
                                    ${dataInstance[headInstance.TRANS_TIME]}
                                </g:if>
                                <g:else>
                                    <a href="${request.getContextPath()}/Manufacture/manufactureDetail?flag=total&clazz=<%=dataInstance.STATE%>&startTime=<%=headInstance.TRANS_TIME%>"
                                       data-toggle="navtab" data-id="dialog-normal"
                                       data-options="{id:'manufactureDetail', title:'${dataInstance.CLAZZ}(${headInstance.TRANS_TIME})总体状况明细'}">
                                        ${dataInstance[headInstance.TRANS_TIME]}
                                    </a>
                                </g:else>
                            </td>
                        </g:each>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </g:if>
    <g:if test="${customerRecGoodsList.size() > 0}">
        <div style="width:96%;height:450px;margin:20px auto" id="customerRecGoodsList"></div>
    </g:if>
    <g:if test="${customerWipList.size() > 0}">
        <div style="width:96%;height:450px;margin:20px auto" id="customerWipList"></div>
    </g:if>
    <g:if test="${customerDelGoodsList.size() > 0}">
        <div style="width:96%;height:450px;margin:20px auto" id="customerDelGoodsList"></div>
    </g:if>
    <g:if test="${projectRecGoodsList.size() > 0}">
        <div style="width:96%;height:450px;margin:20px auto" id="projectRecGoodsList"></div>
    </g:if>
    <g:if test="${projectWipList.size() > 0}">
        <div style="width:96%;height:450px;margin:20px auto" id="projectWipList"></div>
    </g:if>
    <g:if test="${totalList.size() > 0}">
        <div style="width:96%;height:450px;margin:20px auto" id="totalList"></div>
    </g:if>
</div>
<g:render template="../template/echarts"/>
<script type="text/javascript">
    /**
     * 客户来货
     */
    var customerRecGoodsList = function () {
        var myChart = echarts.init(document.getElementById("customerRecGoodsList"));
        var customerList = [];
        var transTimeList = [];
        var datas = [];
        <g:each in="${customerRecGoodsList}" status="i" var="dataInstance">
        <g:if test="${dataInstance.CUSTOMER != '合计'}">
        customerList.push('${dataInstance.CUSTOMER}');
        </g:if>
        </g:each>
        <g:each in="${dateList}" status="j" var="headInstance">
        transTimeList.push('${headInstance.TRANS_TIME}');
        </g:each>
        var option = {
            title: {
                text: '客户来货状况'
            },
            legend: {
                data: customerList
            },
            tooltip: {
                trigger: 'axis',
                axisPointer : {
                    type: 'shadow'
                }
            },
            toolbox: {
                show: true,
                feature: {
                    saveAsImage: {show: true}
                }
            },
            xAxis: {
                name: '日期',
                show: true,
                type: 'category',
                data: transTimeList,
                axisLabel: {
                    rotate: 20,
                    show: true,
                    textStyle: {
                        color: '#3A82B9'
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#3A82B9',
                        width: 2
                    }
                }
            },
            yAxis: [
                {
                    type: 'value',
                    show: true,
                    name: '数量',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#3A82B9',
                            width: 2
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#3A82B9'
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    splitArea: {
                        show: false
                    }
                }
            ],
            series: [
                <g:each in="${customerRecGoodsList}" status="i" var="dataInstance">
                <g:if test="${dataInstance.CUSTOMER != '合计'}">
                {
                    name: '${dataInstance.CUSTOMER}',
                    type: 'bar',
                    stack: '来货',
                    data: [
                        <g:each in="${dateList}" status="j" var="headInstance">
                        <g:if test="${dataInstance[headInstance.TRANS_TIME] == null}">0, </g:if>
                        <g:else>${dataInstance[headInstance.TRANS_TIME]}, </g:else>
                        </g:each>
                    ]
                },
                </g:if>
                </g:each>
            ]
        };
        myChart.setOption(option, true);
    }

    /**
     * 客户在制品
     */
    var customerWipList = function () {
        var myChart = echarts.init(document.getElementById("customerWipList"));
        var customerList = [];
        var transTimeList = [];
        <g:each in="${customerWipList}" status="i" var="dataInstance">
        <g:if test="${dataInstance.CUSTOMER != '合计'}">
        customerList.push('${dataInstance.CUSTOMER}');
        </g:if>
        </g:each>
        <g:each in="${dateList}" status="j" var="headInstance">
        transTimeList.push('${headInstance.TRANS_TIME}');
        </g:each>
        var option = {
            title: {
                text: '客户在制品状况'
            },
            legend: {
                data: customerList
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            toolbox: {
                show: true,
                feature: {
                    saveAsImage: {show: true}
                }
            },
            xAxis: {
                name: '日期',
                show: true,
                type: 'category',
                data: transTimeList,
                axisLabel: {
                    rotate: 20,
                    show: true,
                    textStyle: {
                        color: '#3A82B9'
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#3A82B9',
                        width: 2
                    }
                }
            },
            yAxis: [
                {
                    type: 'value',
                    show: true,
                    name: '数量',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#3A82B9',
                            width: 2
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#3A82B9'
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    splitArea: {
                        show: false
                    }
                }
            ],
            series: [
                <g:each in="${customerWipList}" status="i" var="dataInstance">
                <g:if test="${dataInstance.CUSTOMER != '合计'}">
                {
                    name: '${dataInstance.CUSTOMER}',
                    type: 'bar',
                    stack: '在制品',
                    data: [
                        <g:each in="${dateList}" status="j" var="headInstance">
                        <g:if test="${dataInstance[headInstance.TRANS_TIME] == null}">0, </g:if>
                        <g:else>${dataInstance[headInstance.TRANS_TIME]}, </g:else>
                        </g:each>
                    ]
                },
                </g:if>
                </g:each>
            ]
        };
        myChart.setOption(option, true);
    }

    /**
     * 客户发货
     */
    var customerDelGoodsList = function () {
        var myChart = echarts.init(document.getElementById("customerDelGoodsList"));
        var customerList = [];
        var transTimeList = [];
        <g:each in="${customerDelGoodsList}" status="i" var="dataInstance">
        <g:if test="${dataInstance.CUSTOMER != '合计'}">
        customerList.push('${dataInstance.CUSTOMER}');
        </g:if>
        </g:each>
        <g:each in="${dateList}" status="j" var="headInstance">
        transTimeList.push('${headInstance.TRANS_TIME}');
        </g:each>
        var option = {
            title: {
                text: '客户发货状况'
            },
            legend: {
                data: customerList
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            toolbox: {
                show: true,
                feature: {
                    saveAsImage: {show: true}
                }
            },
            xAxis: {
                name: '日期',
                show: true,
                type: 'category',
                data: transTimeList,
                axisLabel: {
                    rotate: 20,
                    show: true,
                    textStyle: {
                        color: '#3A82B9'
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#3A82B9',
                        width: 2
                    }
                }
            },
            yAxis: [
                {
                    type: 'value',
                    show: true,
                    name: '数量',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#3A82B9',
                            width: 2
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#3A82B9'
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    splitArea: {
                        show: false
                    }
                }
            ],
            series: [
                <g:each in="${customerDelGoodsList}" status="i" var="dataInstance">
                <g:if test="${dataInstance.CUSTOMER != '合计'}">
                {
                    name: '${dataInstance.CUSTOMER}',
                    type: 'bar',
                    stack: '发货',
                    data: [
                        <g:each in="${dateList}" status="j" var="headInstance">
                        <g:if test="${dataInstance[headInstance.TRANS_TIME] == null}">0, </g:if>
                        <g:else>${dataInstance[headInstance.TRANS_TIME]}, </g:else>
                        </g:each>
                    ]
                },
                </g:if>
                </g:each>
            ]
        };
        myChart.setOption(option, true);
    }

    /**
     * 课别-部门 来货
     */
    var projectRecGoodsList = function () {
        var myChart = echarts.init(document.getElementById("projectRecGoodsList"));
        var projectList = [];
        var transTimeList = [];
        <g:each in="${projectRecGoodsList}" status="i" var="dataInstance">
        <g:if test="${dataInstance.KEBIE_DEPT != '合计'}">
        projectList.push('${dataInstance.KEBIE_DEPT}');
        </g:if>
        </g:each>
        <g:each in="${dateList}" status="j" var="headInstance">
        transTimeList.push('${headInstance.TRANS_TIME}');
        </g:each>
        var option = {
            title: {
                text: '课别+部门来货状况'
            },
            legend: {
                data: projectList
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            toolbox: {
                show: true,
                feature: {
                    saveAsImage: {show: true}
                }
            },
            xAxis: {
                name: '日期',
                show: true,
                type: 'category',
                data: transTimeList,
                axisLabel: {
                    rotate: 20,
                    show: true,
                    textStyle: {
                        color: '#3A82B9'
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#3A82B9',
                        width: 2
                    }
                }
            },
            yAxis: [
                {
                    type: 'value',
                    show: true,
                    name: '数量',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#3A82B9',
                            width: 2
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#3A82B9'
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    splitArea: {
                        show: false
                    }
                }
            ],
            series: [
                <g:each in="${projectRecGoodsList}" status="i" var="dataInstance">
                <g:if test="${dataInstance.KEBIE_DEPT != '合计'}">
                {
                    name: '${dataInstance.KEBIE_DEPT}',
                    type: 'bar',
                    stack: '来货',
                    data: [
                        <g:each in="${dateList}" status="j" var="headInstance">
                        <g:if test="${dataInstance[headInstance.TRANS_TIME] == null}">0, </g:if>
                        <g:else>${dataInstance[headInstance.TRANS_TIME]}, </g:else>
                        </g:each>
                    ]
                },
                </g:if>
                </g:each>
            ]
        };
        myChart.setOption(option, true);
    }

    /**
     * 课别-部门 在制品
     */
    var projectWipList = function () {
        var myChart = echarts.init(document.getElementById("projectWipList"));
        var projectList = [];
        var transTimeList = [];
        <g:each in="${projectWipList}" status="i" var="dataInstance">
        <g:if test="${dataInstance.KEBIE_DEPT != '合计'}">
        projectList.push('${dataInstance.KEBIE_DEPT}');
        </g:if>
        </g:each>
        <g:each in="${dateList}" status="j" var="headInstance">
        transTimeList.push('${headInstance.TRANS_TIME}');
        </g:each>
        var option = {
            title: {
                text: '部门+课别在制品状况'
            },
            legend: {
                data: projectList
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            toolbox: {
                show: true,
                feature: {
                    saveAsImage: {show: true}
                }
            },
            xAxis: {
                name: '日期',
                show: true,
                type: 'category',
                data: transTimeList,
                axisLabel: {
                    rotate: 20,
                    show: true,
                    textStyle: {
                        color: '#3A82B9'
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#3A82B9',
                        width: 2
                    }
                }
            },
            yAxis: [
                {
                    type: 'value',
                    show: true,
                    name: '数量',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#3A82B9',
                            width: 2
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#3A82B9'
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    splitArea: {
                        show: false
                    }
                }
            ],
            series: [
                <g:each in="${projectWipList}" status="i" var="dataInstance">
                <g:if test="${dataInstance.KEBIE_DEPT != '合计'}">
                {
                    name: '${dataInstance.KEBIE_DEPT}',
                    type: 'bar',
                    stack: '在制品',
                    data: [
                        <g:each in="${dateList}" status="j" var="headInstance">
                        <g:if test="${dataInstance[headInstance.TRANS_TIME] == null}">0, </g:if>
                        <g:else>${dataInstance[headInstance.TRANS_TIME]}, </g:else>
                        </g:each>
                    ]
                },
                </g:if>
                </g:each>
            ]
        };
        myChart.setOption(option, true);
    }

    /**
     * 总体状况
     */
    var totalList = function () {
        var myChart = echarts.init(document.getElementById("totalList"));
        var projectList = [];
        var transTimeList = [];
        <g:each in="${totalList}" status="i" var="dataInstance">
        <g:if test="${dataInstance.CLAZZ != '合计'}">
        projectList.push('${dataInstance.CLAZZ}');
        </g:if>
        </g:each>
        <g:each in="${dateList}" status="j" var="headInstance">
        transTimeList.push('${headInstance.TRANS_TIME}');
        </g:each>
        var option = {
            title: {
                text: '总体状况'
            },
            legend: {
                data: projectList
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            toolbox: {
                show: true,
                feature: {
                    saveAsImage: {show: true}
                }
            },
            xAxis: {
                name: '日期',
                show: true,
                type: 'category',
                data: transTimeList,
                axisLabel: {
                    rotate: 20,
                    show: true,
                    textStyle: {
                        color: '#3A82B9'
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#3A82B9',
                        width: 2
                    }
                }
            },
            yAxis: [
                {
                    type: 'value',
                    show: true,
                    name: '数量',
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#3A82B9',
                            width: 2
                        }
                    },
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#3A82B9'
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    splitArea: {
                        show: false
                    }
                }
            ],
            series: [
                <g:each in="${totalList}" status="i" var="dataInstance">
                <g:if test="${dataInstance.CLAZZ != '合计'}">
                {
                    name: '${dataInstance.CLAZZ}',
                    type: 'bar',
                    data: [
                        <g:each in="${dateList}" status="j" var="headInstance">
                        <g:if test="${dataInstance[headInstance.TRANS_TIME] == null}">0, </g:if>
                        <g:else>${dataInstance[headInstance.TRANS_TIME]}, </g:else>
                        </g:each>
                    ]
                },
                </g:if>
                </g:each>
            ]
        };
        myChart.setOption(option, true);
    }

    $(function() {
        <g:if test="${customerRecGoodsList.size() > 0}">
        customerRecGoodsList();
        </g:if>
        <g:if test="${customerWipList.size() > 0}">
        customerWipList();
        </g:if>
        <g:if test="${customerDelGoodsList.size() > 0}">
        customerDelGoodsList();
        </g:if>
        <g:if test="${projectRecGoodsList.size() > 0}">
        projectRecGoodsList();
        </g:if>
        <g:if test="${projectWipList.size() > 0}">
        projectWipList();
        </g:if>
        <g:if test="${totalList.size() > 0}">
        totalList();
        </g:if>
    });
</script>